package yang.action;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import yang.pageModel.DataGrid;
import yang.pageModel.Finance;
import yang.service.FinanceServiceI;
/**
 * 
 * @ClassName: FinanceAction
 * @Description: 财务控制器
 * @author: Administrator
 * @date: 2014年7月12日 上午9:32:40
 */
@Action("financeAction")
public class FinanceAction extends BaseAction implements ModelDriven<Finance>{
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(FinanceAction.class);
	Finance finance=new Finance();
	
	private FinanceServiceI financeService;
	public void findAllFinance(){
		DataGrid grid=null;
		try {
			grid = financeService.findAllFinance(finance);
			logger.info("查询成功");
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
		}
		super.writeJson(grid);
	}
	//------- get set ----------
	public FinanceServiceI getFinanceService() {
		return financeService;
	}
	@Autowired
	public void setFinanceService(FinanceServiceI financeService) {
		this.financeService = financeService;
	}
	/**
	 * @Title: getModel
	 * @Description: 模型驱动
	 * @return
	 * @see com.opensymphony.xwork2.ModelDriven#getModel()
	 */
	@Override
	public Finance getModel() {
		return finance;
	}


	
}
